# 循环
# while循环
# while 输出 1-5
count = 1
while count < 6:
    print(count)
    count += 1
print("========================")

# while + break 输出 1-4
a = 0
while True:
    if a > 3:
        break
    a += 1
    print(a)
print("========================")

# while + continue 输出 3
b = 0
while True:
    b += 1
    if b < 3:
        continue
    print(b)
    break
print("========================")

# for循环 列表 输出 1 2 3
for x in [1, 2, 3]:
    print(x)
# for循环 字典 变量x取key  输出  k1 1 k2 2 k3 3
dic = {'k1': 1, 'k2': 2, 'k3': 3}
for x in dic:
    print(x)
    print(dic[x])

# for+range 通过range控制for循环次数
for x in range(10):  # 输出 0123456789
    print(x, end='')

print()

for x in range(0, 10):  # 输出 0123456789  取头不取尾
    print(x, end='')

print()

for x in range(1, 9, 2):  # 输出 1357  第三位2为步长，每次循环增加的值
    print(x, end='')

print()

 
